package com.termux.ui.ide.tab

import android.view.View
import java.io.File

open class FileTab(var file: File?) {

    var contentView: View? = null
    var changed: Boolean = false

    open fun onSelected() {

    }
    open fun save() {

    }
    open fun onClose() {

    }

    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (other == null || javaClass != other.javaClass) return false
        val fileTab = other as FileTab
        return file == fileTab.file
    }

    override fun hashCode(): Int {
        var result = file?.hashCode() ?: 0
        result = 31 * result + (contentView?.hashCode() ?: 0)
        result = 31 * result + changed.hashCode()
        return result
    }
}